package org.stvd.repository.admin.impl;

import org.springframework.stereotype.Repository;
import org.stvd.core.dto.QueryResult;
import org.stvd.entities.admin.DictionaryType;
import org.stvd.repository.admin.DictionaryTypeDao;
import org.stvd.repository.base.impl.BaseDaoImpl;

/**
 * @Title: DictionaryTypeDaoImpl	
 * @Description: 字典类型-Repository接口实现类
 * @author houzx
 * @date 2020年2月7日
 */
@Repository("DictionaryTypeDao")
public class DictionaryTypeDaoImpl extends BaseDaoImpl<DictionaryType> implements
    DictionaryTypeDao {

    @Override
    public QueryResult<DictionaryType> queryDictionaryTypeResult(int start, int limit, String id, String name) {
        String hql = "FROM DictionaryType WHERE (id = ?0 OR '' = ?0) AND name LIKE ?1 ORDER BY serialNo";
        return getQueryResultByHQL(start, limit, hql, id, "%"+name+"%");
    }

}
